using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TT.Module.sysLogin;
using System.Data;
using SfcorpDLL.dao;

namespace SfcorpDLL.biz
{
    public class bizAccount
    {
        etyBaeSystemParamter basSysParam;
        daoAccount doAccount;

        public bizAccount(etyBaeSystemParamter ieyBasClassDeclare)
        {
            basSysParam = ieyBasClassDeclare;
            doAccount = new daoAccount(basSysParam);
        }
        public IList<GT.ORM.etyChargeHdr> GetPreAccComp(DateTime fromDate, DateTime toDate)
        {
            DataTable dt = doAccount.GetPreAccComp(fromDate, toDate);
            IList<GT.ORM.etyChargeHdr> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeHdr>(dt);
            return ilRusult;
        }
        public IList<GT.ORM.etyChargeDtl> GetBillResult(DateTime fromDate, DateTime toDate, string compNo)
        {
            DataTable dt = doAccount.GetBillResult(fromDate, toDate, compNo);
            IList<GT.ORM.etyChargeDtl> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeDtl>(dt);
            return ilRusult;
        }
        public IList<GT.ORM.etyChargeHdr> GetChargeHdrList(GT.ORM.etyChargeDtl inEty)
        {
            DataTable dt = doAccount.GetChargeHdrList(inEty);
            IList<GT.ORM.etyChargeHdr> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeHdr>(dt);
            return ilRusult;
        }
        public IList<GT.ORM.etyChargeDtl> GetChargeDtl(GT.ORM.etyChargeDtl inEty)
        {
            DataTable dt = doAccount.GetChargeDtl(inEty);
            IList<GT.ORM.etyChargeDtl> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeDtl>(dt);
            return ilRusult;
        }
        public IList<GT.ORM.etyChargeDtl> GetCompCharge(GT.ORM.etyChargeDtl inEty)
        {
            DataTable dt = doAccount.GetCompCharge(inEty);
            IList<GT.ORM.etyChargeDtl> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeDtl>(dt);
            return ilRusult;
        }
        public DataTable GetCompChargeCross(GT.ORM.etyChargeDtl inEty)
        {
            DataTable dt = doAccount.GetCompChargeCross(inEty);
            DataTable dtCross = TT.Common.dataProcessor.DataTableCross(dt, "Cross", "ITEM_DESC", "AMOUNT",0,"","");
            //IList<GT.ORM.etyChargeDtl> ilRusult = TT.Common.Converts.ConvertToIList<GT.ORM.etyChargeDtl>(dt);
            return dtCross;
        }
        public bool SaveChargeHdrDtl(IList<GT.ORM.etyChargeDtl> chrgDtl)
        {
            return doAccount.SaveChargeHdrDtl(chrgDtl);
        }

        public bool UpdateChargeHdr(GT.ORM.etyChargeHdr chrgHdr)
        {
            return doAccount.UpdateChargeHdr(chrgHdr);
        }

        public bool DeleteChargeHdr(GT.ORM.etyChargeHdr chrgHdr)
        {
            return doAccount.DeleteChargeHdr(chrgHdr);
        }

    }
}
